<template>
  <!--  风险报告-->
  <Table :table-column="tableColumn" max-height="400px" :table-data="tableData" :page="false" border
         :headerStyle="{backgroundColor:'#fffbed'}">
  </Table>
</template>

<script>
import {riskReport} from '@/api/order'
export default {
  props: ['routesQuery'],
  data() {
    return {
      tableData: [],
      tableColumn: [
        {label: this.$t('报表类型'), prop: 'name', align: 'center'},
        {label: this.$t('报告结果'), prop: 'isHit', align: 'center', isHtml: true},
      ]
    }
  },
  mounted() {
    this.getList()
  },
  methods: {
    async getList() {
      const {userStubId} = this.routesQuery
      const res = await riskReport({
        userStubId: parseInt(userStubId)
      })
      if (res.code === 1) {
        this.tableData = res.data.map(item => {
          item.isHit =  item.isColor === 1 ? `<span style="color: #ff0000">${item.value}</span>` : item.value
          return item
        })
      }
    }
  }
}
</script>

<style scoped>

</style>
